home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue70 / Clinic / COMSolution2 / ComClass2Impl.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  2001-04-05  |  621 b   |  34 lines

  1. unit ComClass2Impl;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, ActiveX, Classes, ComObj, BaseLib_TLB;
  7.  
  8. type
  9.   TComClass2 = class(TComObject, IFoo)
  10.   protected
  11.     {Declare IFoo methods here}
  12.     procedure Bar; safecall;
  13.   end;
  14.  
  15. const
  16.   Class_ComClass2: TGUID = '{65397276-6BDD-4792-BFB6-00231B79EECC}';
  17.  
  18. implementation
  19.  
  20. uses
  21.   ComServ, Dialogs, CommonUnit;
  22.  
  23. { TComClass2 }
  24.  
  25. procedure TComClass2.Bar;
  26. begin
  27.   ShowMessage('Hello from a TComClass2 in ComServer2.dll')
  28. end;
  29.  
  30. initialization
  31.   TComObjectFactory.Create(ComServer, TComClass2, SharedClassID,
  32.     'ComClass2', '', ciInternal, tmApartment);
  33. end.
  34.